package com.jack.vipmis.vip.card.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.validator.constraints.NotBlank;

import com.google.common.collect.Lists;
import com.jack.vipmis.common.entity.BaseEntity;
import com.jack.vipmis.common.plugin.entity.Movable;

/**
 * 会员卡类型cardclass
 * 
 * @author JackLiang
 * @date 2014-7-2
 * @version 1.0
 */
@Entity
@Table(name = "cardType")
public class CardType extends BaseEntity<Long> implements Movable {

	@Column
	private String		typeName;

	@Column
	@NotBlank
	private String		typeCode;

	@Column(name = "weight")
	private Integer		weight;						// 权重

	@Column
	private String		typeOfCode;

	@Column
	private String		remark;

	@Column(name = "is_show")
	private Boolean		show;

	@OneToMany(mappedBy = "cardTaste", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.MERGE,
			CascadeType.REMOVE })
	private List<Card>	cards	= Lists.newArrayList();

	// setter getter
	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getTypeCode() {
		return typeCode;
	}

	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}

	public Integer getWeight() {
		return weight;
	}

	public void setWeight(Integer weight) {
		this.weight = weight;
	}

	public String getTypeOfCode() {
		return typeOfCode;
	}

	public void setTypeOfCode(String typeOfCode) {
		this.typeOfCode = typeOfCode;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Boolean getShow() {
		return show;
	}

	public void setShow(Boolean show) {
		this.show = show;
	}

	public List<Card> getCards() {
		return cards;
	}

	public void setCards(List<Card> cards) {
		this.cards = cards;
	}

}
